Clustering requests and prioritizing workmanager threads based on resource performance and/or availability

ABSTRACT

In a system for providing data and/or computational services, various resources are assigned a sort of points (called vouchers or IOUs) for work manager threads that are currently queued at each resource. When a resource (and its associated resource manager) has a relatively small queue, whereby the resource is holding a relatively small number of points, that resource will be assigned work manager threads for incoming services requests at a high preference, or priority. In this way, faster performing resources can more reliably be supplied with new requests, while relatively slow performing resources will tend not to unduly tie up limited work manager threads in long queues at the slow resources.

BACKGROUND OF THE INVENTION

The present invention relates generally to the field of “work managerthreads” (see definition, below, in Definitions sub-section of theDetailed Description section), and more particularly to managingmultiple active work manager threads.

In application server environments, there are typically hundreds, orthousands, of concurrent users (“clients”). Each of these clientstypically sends requests to the application server system. In order tohandle all of the clients, a server computer typically has: (i) manyresources (for example, processors, data storage devices); (ii) for eachresource, a resource manager to manage the use of each resource inresponding to these client requests; and (iii) work manager threads forcommunicating: (a) incoming client requests to the appropriate resourcemanager, and (b) request responses from each resource manager backtoward the client who made the request. More specifically, the workmanager threads: (i) take requests from the clients; (ii) apply therequests to the various resource managers of the server; and (iii)control and manage responses to the requests (for example, sendapplications, or results from running applications, back to theclients).

SUMMARY

According to an aspect of the present invention, there is a method,system and computer program product that performs the following steps(not necessarily in the following order): (i) dividing a set of vouchersinto a plurality of voucher subsets so that each voucher sub-setrespectively corresponds to a resource manager of a plurality ofresource managers, where each resource manager of the plurality ofresource managers respectively corresponds to a resource in anapplication server; (ii) receiving a plurality of incoming pendingrequests with each incoming pending request respectively correspondingto a resource; (iii) temporarily removing a voucher from its vouchersubset corresponding to a given resource manager upon each instance thata given pending incoming request is assigned to that given resourcemanager for responsive processing such that the given pending incomingrequest thereby becomes an assigned request; and (iv) determining whichrequest of the plurality of pending incoming requests will be nextassigned to a corresponding resource manager based, at least in part,upon which resource manager has the greatest number of vouchers in itsrespective subset of vouchers.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is a schematic view of a first embodiment of a server computersystem according to the present invention;

FIG. 2 is a flowchart showing a process performed, at least in part, bythe first embodiment computer system;

FIG. 3 is a schematic view of a software portion of the first embodimentcomputer system;

FIG. 4 is a schematic view of a second embodiment of a server computersystem according to the present invention;

FIG. 5 is another schematic view of the second embodiment servercomputer system;

FIG. 6 is a flowchart showing a process performed, at least in part, bythe second embodiment computer system; and

FIG. 7 is a flowchart showing a process performed, at least in part, bythe second embodiment computer system.

DETAILED DESCRIPTION

This Detailed Description section is divided into the followingsub-sections: (i) The Hardware and Software Environment; (ii) ExampleEmbodiment; (iii) Further Comments and/or Embodiments; and (iv)Definitions.

I. The Hardware and Software Environment

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

An embodiment of a possible hardware and software environment forsoftware and/or methods according to the present invention will now bedescribed in detail with reference to the Figures. FIG. 1 is afunctional block diagram illustrating various portions of first serversub-system 11. First server sub-system 11 receives requests forresources from other remote computers (not shown) in a larger computersystem of which server sub-system 11 is a constituent part. As will beappreciated by those of skill in the art, the requests may be received,and responded to, through a wide area and/or local area network (notshown) of any type now known or to be developed in the future. As shownin FIG. 1, sub-system 11 includes: first server computer 20; displaydevice 21; and external devices 22 (including first resource 22 a andsecond resource 22 b). First server computer 20 includes: communicationunit 30; processor(s) set 31; input/output (I/O) interface set 32;memory device 33; persistent storage device 34; random access memory(RAM) device 40; cache memory device 41; and program 75. Sub-system 11is, in many respects, representative of the various computersub-system(s) in the present invention. Accordingly, several portions ofsub-system 11 will now be discussed in the following paragraphs.

Sub-system 11 may be a laptop computer, tablet computer, netbookcomputer, personal computer (PC), a desktop computer, a personal digitalassistant (PDA), a smart phone, or any programmable electronic devicecapable of communicating with the client sub-systems via one or morenetwork(s) (not separately shown). Program 75 is a collection of machinereadable instructions and/or data that is used to create, manage andcontrol certain software functions that will be discussed in detail,below, in the Example Embodiment sub-section of this DetailedDescription section.

Sub-system 11 is capable of communicating with other computersub-systems via a network (not separately shown). The network(s) can be,for example, a local area network (LAN), a wide area network (WAN) suchas the Internet, or a combination of the two, and can include wired,wireless, or fiber optic connections. In general, the network(s) can beany combination of connections and protocols that will supportcommunications between server and client sub-systems.

Sub-system 11 is shown as a block diagram with many double arrows. Thesedouble arrows (no separate reference numerals) represent acommunications fabric, which provides communications between variouscomponents of sub-system 11. This communications fabric can beimplemented with any architecture designed for passing data and/orcontrol information between processors (such as microprocessors,communications and network processors, etc.), system memory, peripheraldevices, and any other hardware components within a system. For example,the communications fabric can be implemented, at least in part, with oneor more buses.

The memory and the persistent storage are computer-readable storagemedia. In general, memory 33 can include any suitable volatile ornon-volatile computer-readable storage media.

Program 75 is stored in the persistent storage for access and/orexecution by one or more of the processors of the processor(s) set,usually through one or more memories of memory device 33. Persistentstorage 34: (i) is at least more persistent than a signal in transit;(ii) stores the program (including its soft logic and/or data), on atangible medium (such as magnetic or optical domains); and (iii) issubstantially less persistent than permanent storage. Alternatively,data storage may be more persistent and/or permanent than the type ofstorage provided by persistent storage 34.

Program 75 may include both machine readable and performableinstructions and/or substantive data (that is, the type of data storedin a database). In this particular embodiment, persistent storage 34includes a magnetic hard disk drive. To name some possible variations,persistent storage 34 may include a solid state hard drive, asemiconductor storage device, read-only memory (ROM), erasableprogrammable read-only memory (EPROM), flash memory, or any othercomputer-readable storage media that is capable of storing programinstructions or digital information.

The media used by persistent storage 34 may also be removable. Forexample, a removable hard drive may be used for persistent storage 34.Other examples include optical and magnetic disks, thumb drives, andsmart cards that are inserted into a drive for transfer onto anothercomputer-readable storage medium that is also part of persistent storage34.

Communications unit 30, in these examples, provides for communicationswith other data processing systems or devices external to sub-system 11.In these examples, communications unit 30 includes one or more networkinterface cards. Communications unit 30 may provide communicationsthrough the use of either or both physical and wireless communicationslinks. Any software modules discussed herein may be downloaded to apersistent storage device (such as persistent storage device 34) througha communications unit (such as communications unit 30).

I/O interface set 32 allows for input and output of data with otherdevices that may be connected locally in data communication with servercomputer 20. For example, I/O interface set 32 provides a connection toexternal device set 22.

External device set 22 will typically include devices such as akeyboard, keypad, a touch screen, and/or some other suitable inputdevice. External device set 214 can also include portablecomputer-readable storage media such as, for example, thumb drives,portable optical or magnetic disks, and memory cards. Software and dataused to practice embodiments of the present invention, for example,program 75, can be stored on such portable computer-readable storagemedia. In these embodiments the relevant software may (or may not) beloaded, in whole or in part, onto persistent storage device 34 via I/Ointerface set 32. I/O interface set 32 also connects in datacommunication with display device 21. In this embodiment, externaldevice set 22 includes a first resource 22 a and a second resource 22 b.Each resource 22 a, 22 b includes a resource manager (not separatelyshown), but the resource manager may not be wholly, or even partially,physically located in the resource that it respectively manages. In thisexample, the primary purpose of first server sub-system 11 is to servethe services of these two resources. These two resources may themselvesinclude one or more computers, processors, memories and/or storagedevices, as well as software and/or firmware. The Further CommentsAnd/Or Embodiments sub-section of this Detailed Description section willdiscuss at least some of the types of resources that a server may serve.

Display device 21 provides a mechanism to display data to a user and maybe, for example, a computer monitor or a smart phone display screen.

The programs described herein are identified based upon the applicationfor which they are implemented in a specific embodiment of theinvention. However, it should be appreciated that any particular programnomenclature herein is used merely for convenience, and thus theinvention should not be limited to use solely in any specificapplication identified and/or implied by such nomenclature.

II. Example Embodiment

FIG. 2 shows flowchart 50 showing a method according to the presentinvention. FIG. 3 shows program 75 for performing at least some of themethod steps of flowchart 50. This method and associated software willnow be discussed, over the course of the following paragraphs, withextensive reference to FIG. 2 (for the method step blocks) and FIG. 3(for the software blocks).

Processing begins at step S52, where voucher division module (“mod”) 77takes a set of vouchers and divides them into subsets respectivelycorresponding to the resources 22 a, 22 b (see FIG. 1). As mentionedabove, in this example, references to resources should be taken toinclude the resource manager that respectively manages each resource.Each voucher subset represents the total number of vouchers that can beassigned to the corresponding resource, but, at step S52, before thestart of normal operations, none of the vouchers of either subset (thatis, the first resource subset and the second resource subset) has yetbeen assigned to the corresponding resource. In this example, the numberof vouchers that is divided into subsets is equal to the number of workmanager threads in work thread manager pool sub-mod 81 a (see FIG. 3).In this example, the number of work threads manager is sixty (60).Further, in this example, the subsets are divided by mod 77 such thatthe ratio of the proportion of total vouchers in each subset reflectsthe proportion of incoming pending requests that are expected to bedirected to the corresponding resource. In this example, two thirds ofthe requests are expected to be directed to first resource 22 a, and onethird of the requests are expected to be directed to second resource 22b, meaning that: (i) the subset of vouchers corresponding to the firstresource is forty (40); and (ii) the subset of vouchers corresponding tothe second resource is twenty (20).

Processing proceeds to step S54 where normal operations start, meaningthat receive requests mod 79 receives pending incoming requests, witheach pending incoming request being directed, in this example, to thefirst resource or the second resource. These pending incoming requestscome to first server sub-system from other computers in the largernetworked computer system of which server sub-system 11 forms a part.These pending incoming requests are accepted in the currentlyconventional manner in this embodiment, making extended discussion ofthis method step unnecessary.

Processing proceeds to Step S56 where request assignment and responsemod 81: (i) converts the pending incoming requests into assignedrequests by assigning them to a work manager thread for queuing at therespectively requested resource; (ii) decrements the appropriate vouchersubset as each pending incoming request is converted to an assignedrequest; (iii) upon receiving a response from a resource, converts theassigned request into a completed request by removing the request fromits previously assigned work manager thread; (iv) delivers the responseof the completed request back to the requesting device (this part isconventional); and (v) increments the appropriate voucher subset as eachassigned request is converted to a completed request. In performingthese actions: (i) the work manager threads come from work managerthread pool sub-mod 81 a; (ii) the incrementing and decrementing ofvouchers is performed by voucher tracking sub-mod 81 b; and (iii) therequests are assigned work manager threads, and later “un-assigned” workmanager threads, by request assignment sub-mod 81 c.

During the normal operations of step S56, if either resource isperforming fast then it will tend to have a short queue of assignedrequests, and will therefore tend to have, at any given time, relativelyfew vouchers temporarily decremented from its corresponding vouchersubset. For similar reasons, if either resource is performing slowlythen it will tend to have a long queue of assigned requests, and willtherefore tend to have, at any given time, relatively numerous voucherstemporarily decremented from its corresponding voucher subset. Theforegoing reasoning is what allows the number of vouchers remaining in aresource's voucher subset to be used as a sort of proxy for how fast theresource is performing. This can be useful information as will be seen,below, in the discussion of step S58.

Processing proceeds to step S58, which focuses on the assignment of asingle work thread to a single pending incoming request. Step S58 issimply a part of the actions that take place numerous times as step S56is ongoing, but, for purposes of understanding operation of thisembodiment of the present invention, it is helpful to focus on a singleassignment of a single pending incoming request to a work manager threadfor queuing at the corresponding resource manager/resource. Morespecifically, request assignment sub-mod has many pending incomingrequests, variously directed to both the first and second resources, tohandle and assign at any given time. However, the machine logic ofsub-mod 81 c must determine which pending incoming request to nextassign by assigning a work manager thread.

In this simple example, the choice is limited to the followingalternatives: (i) the next assigned request will be the earliestreceived request directed to the first resource; or (ii) the nextassigned request will be the earliest received request directed to thesecond resource. As between these two alternatives, sub-mod 81 c willchoose the request whose corresponding resource has the most vouchersleft in its subset, and this is the request that will be converted froma pending incoming request into an assigned request by assigning a workmanager thread from work manager thread pool sub-mod 81 a. If there areno threads left in the thread pool, then the determination of whichpending incoming request to assign, and the consequent assignment, willawait the availability of a work manager thread that is returned to thepool by virtue of completion of a previously-assigned request.

Some variations will now be mentioned. Some embodiments of the presentinvention will have more (perhaps many more) than three resources. Also,some embodiments may consider, in determining which request to assignnext, factors that go beyond: (i) when the request was received; and(ii) voucher subset numbers. For example, there may be a priority schemeassociated with the requests that additionally takes into account otherfactors such as the identity of the requester.

III. Further Comments and/or Embodiments

Some embodiments of the present invention recognize that when anapplication has to access multiple “resource managers” (which willgenerally have a different level of performance relative to each other),the resources in the application server may become disproportionatelyconsumed by relatively slow-performing resource manager(s) at the costof faster performance which could have been realized if faster resourcemanagers had been used. For example, an application, and its attendantservice back to the client, might need to access multiple resourcemanagers such as: (i) message provider resource manager; (ii) a firstdatabase resource manager for providing data for running theapplication; and (iii) a second database resource manager for servingapplication requests. In this example, all three of the resourcemanagers will have varying degrees of response time depending on factorssuch as: (i) network speed to individual resource managers; (ii) loadand capability of the resource managers; and (iii) system configurationhosting resource managers. The requests to relatively slow-performingresource manager(s) will generally take a longer period of time toreceive a response. This becomes a limiting factor with the speed atwhich the client is served.

Some embodiments of the present invention recognize that these longresponse periods of slow performing resource managers effectively holdthe VM (virtual machine) resources, such as work manager threads,“hostage.” As a result, these resources will not be available toapplication requests interacting with better performing resources. Forthis reason, in a production environment, a work manager thread pool canget filled up quickly, and the pool will deny threads to requests,including threads that do not involve connecting to a slow resourcemanager (such as a slow database). Some embodiments of the presentinvention recognize that a single application module normally runs on asingle VM and any performance problem with backend resource or networkwill render the thread pool as a sort of “hostage.” This could alsohappen when there is a complex query that might take a long time tocomplete on a single database. Many requests that will not need databaseaccess will not be immediately allocated for service threads in thefilled-up thread pool and these requests will wait as well.

Some embodiments of the present invention further recognize one, ormore, of the following potential problems, shortcomings and/oropportunities for improvement with respect to the state of the art: (i)changing the connection pool settings to lower value will still haveimpact because threads will still be forced to wait as a consequence ofthe connection pool having a lower size; (ii) increasing the threadpool, or setting a control that allows growth, could hang the VM andcause an application outage; (iii) running the same application on themultiple VMs or clusters will also not usually be helpful because allrequests eventually connect to the same slow resource managers and allVMs will face similar performance issues.

Some embodiments of the present invention may include one, or more, ofthe following features, characteristics and/or advantages: (i)clustering of work manager threads based on the resource that the workmanager threads need to utilize; (ii) prioritizing of requests, whileallocating work manager threads, based on performance of the resourcethe work needs to utilize; and/or (iii) clusters of work manager threadsconnecting to slow-performing resource are given lower priority atruntime based on successful completion of work relatively compared tothe faster performing resources.

FIGS. 4 and 5 show virtual machine web application server system 200,including: clustered request set 202; work manager thread pool 204;message-oriented middleware resource 210; slow database resource 220;fast database resource 230; and delayed work manager thread requests240. In this example, a web module “module1” of an application “app1”makes a request that involves connecting to multiple resources 210, 220,230. In some situations, a particular request is likely to be respondedto slowly due to network issues, firewall problems or a complex query.In these situations, a resource (for example, database) will typicallytake a few seconds to a few minutes to respond. These requests (hereinsometimes referred to as work manager thread requests) will hold anassociated work manager thread waiting until the slow resource (forexample, the slow database) responds.

However, in system 200: (i) work manager threads of work manager threadpool 204 that require connection to a common, single resource areidentified and grouped (or “clustered”) in clustered requests set 200;(ii) each cluster is provided with a set of “I owe you” (IOU) tickets;(iii) every request to a resource 210, 220 or 230, from a cluster incluster set 202, will utilize single IOU Ticket (not separately shown);(iv) once the execution is successfully completed by the resource, andcontrol returned to work manager thread pool 204 (also referred to asthe “container”), back from the resource, the IOU ticket is returned tothe container; (v) the priority is determined based on the number oftickets consumed; (vi) in this embodiment, slowest resource 210, 220 or230 would be the resource that is holding the most IOU tickets (becausewhen requests take a longer time to return from a resource then thatresource will tend to have a greater number of IOU tickets); (vii)during normal operations (also called “runtime”), the identity of theslowest resource(s) may change; (viii) when fastest-to-slowest rankingof the resources 220, 230, 210 changes (based on changes in how many IOUeach resource holds) then there will generally be a change in priorityorder in assigning work manager threads of container 204.

Clustering work manager threads will now be discussed in more detail.Every request to access a different resource 220, 230, 210 will beidentified with application components mapped to resources as part of aresource reference in web.xml. During bootstrap of the application, orfirst access of the application component each application component isprovided with an identification code (or “ID”) based on the identity ofthe resource 210,220,230 required by that application component.Requests to the application are then assigned work manager threads basedon the availability of IOU tickets for the associated ID. The clusteringof the requests into cluster set 202 helps to prioritize the workmanager threads of container 204.

The setting of dynamic priority for clustered work threads of container204 (also called the “container”) will now be discussed in more detail.The container will assign a number of “I Owe You” (IOU) tickets (or,simply, “tickets”) to each clustered group of work manager threads. Eachclustered group of work manager threads respectively corresponds to aresource manager. The number of tickets for each cluster is assignedaccording to the proportion of incoming request for a given resource.For instance, assume that there are: (i) 100 available work managerthreads in work manager thread pool 204, and (ii) three resourcemanagers/resources that are accessed through these 100 available workmanager threads. Under these assumptions, if the ratio of incomingrequests to these resource managers (RM) is approximately 1:1:2 (in thisembodiment, this ratio is determined based on manually configuredweights) for three resource managers, then: (i) IOU for 1st RM=100/4=25;(ii) IOU for 2nd RM=100/4=25; and (iii) IOU for 3rd RM=100/4*2=50. Adefault IOU value for each can be implemented as a configurable priorityfor a resource manager by application deployers.

In the embodiment under discussion, the container deducts one IOU ticket(or, simply “IOU,” also sometimes herein called “voucher”) from assignedIOU tickets of the clustered group for every request to a correspondingresource manager just before the control is passed to a driver or a“ConnectionFactory.” Once the update is done successfully and control isreturned back to the application server container, the IOU is returnedback to the clustered group.

If a given resource is slow (this can happen for various reasons), theIOUs keep getting decremented and a slow resource will have few, if any,IOUs. The fastest resource will: (i) have highest number of associatedIOUs; and (ii) is given highest priority while allocating a work managerthread. If all the IOU count for a resource drops to zero, then therequests to that resource have to wait until a prior request returns andthereby replenishes an IOU so that a new work manager thread can beallocated. As the number of IOUs varies over time according to resourceperformance, the priority order of the system's resources will varyaccordingly, which will effectively, dynamically control the manner inwhich work manager threads are allocated on an ongoing basis.

As shown in FIG. 6, flow chart (or, algorithm) 300 represents anembodiment of an algorithm, according to the present invention, forassigning requests to resource managers and work manager threads withassociated IOU recordkeeping. Flow chart 300 includes, with process flowas shown in FIG. 6, the following steps: S302 (receive incoming requestfor access to a resource); S304 (every resource manager is given aunique identification (ID), in this example RM1, RM2 . . . RMx . . .RMn); S306 (the first request is sent to a given resource manager RMxand it is determined whether this is the first time that RMx hasreceived a request); S308 (if it is the first time that resource managerRMx has had a request addressed to it then the number of IOUs that RMxhas (that is, variable IOU_RMx) is initialized; S312 (it is determinedwhether RMx has more than zero available IOUs; S310 (on condition thatRMx has no available IOU the request of step S302 is added to therequest queue for RMx); Note: The request is added to the queue for RMxwhen there are no IOUs available. Later when an IOU becomes availablewhen a thread is returned back to the work manager pool, this request isprocessed. Thus S310 should not be connected to S314; S314 (it isdetermined whether there is at least one free thread in the work managerpool); and S316 (on condition that there is a free thread in the workmanager pool then: (i) variable IOU_RMx is decremented by one, and (ii)a free work manager thread is assigned to access RMx for purposes offulfilling the request received at step S302).

As shown in FIG. 7, flow chart (or, algorithm) 400 represents analgorithm, according to an embodiment of the present invention, forreceiving a request response from a resource manager through a workmanager thread and performing associated IOU recordkeeping. Flow chart400 includes, with process flow as shown in FIG. 7, the following steps:S402 (process request response from resource manager RMx whichpreviously received the request through algorithm 300); S404 (incrementRMx); S406 (determine whether any request is currently waiting on RMx;S408 (on condition that a request is waiting on RMx determine whetherthere are any available work manager threads in the work manager threadpool); S410 (on condition that there are no available work managerthreads, add RMx to the resource manager wait queue); S412 (decrementIOU_RMx and assign an available work manager thread for the requestresults obtained through RMx); and S414 (end).

Some embodiments of the present invention may include one, or more, ofthe following features, characteristics and/or advantages: (i) optimalusage of work manager threads to serve faster performing resources andnon resource access requests; (ii) work manager threads are not“hostage” to a slow Database or slow network performance; (iii) can alsohave traditional thread priority manually set on the work manager pool,that will override the clustering of requests according to resources andresource performance based priority setting; (iv) clustering workmanager threads based on the resource the thread needs to access as partof work; (v) resource performance based priority to allocate workmanager thread; (vi) method and approach of using IOU tickets to measurethe performance at runtime, to set priority accordingly and to allocatework manager threads.

IV. Definitions

Present invention: should not be taken as an absolute indication thatthe subject matter described by the term “present invention” is coveredby either the claims as they are filed, or by the claims that mayeventually issue after patent prosecution; while the term “presentinvention” is used to help the reader to get a general feel for whichdisclosures herein that are believed as maybe being new, thisunderstanding, as indicated by use of the term “present invention,” istentative and provisional and subject to change over the course ofpatent prosecution as relevant information is developed and as theclaims are potentially amended.

Embodiment: see definition of “present invention” above—similar cautionsapply to the term “embodiment.”

and/or: inclusive or; for example, A, B “and/or” C means that at leastone of A or B or C is true and applicable.

Module/Sub-Module: any set of hardware, firmware and/or software thatoperatively works to do some kind of function, without regard to whetherthe module is: (i) in a single local proximity; (ii) distributed over awide area; (iii) in a single proximity within a larger piece of softwarecode; (iv) located within a single piece of software code; (v) locatedin a single storage device, memory or medium; (vi) mechanicallyconnected; (vii) electrically connected; and/or (viii) connected in datacommunication.

Software storage device: any device (or set of devices) capable ofstoring computer code in a manner less transient than a signal intransit.

Tangible medium software storage device: any software storage device(see Definition, above) that stores the computer code in and/or on atangible medium.

Non-transitory software storage device: any software storage device (seeDefinition, above) that stores the computer code in a non-transitorymanner.

Computer: any device with significant data processing and/or machinereadable instruction reading capabilities including, but not limited to:desktop computers, mainframe computers, laptop computers,field-programmable gate array (fpga) based devices, smart phones,personal digital assistants (PDAs), body-mounted or inserted computers,embedded device style computers, application-specific integrated circuit(ASIC) based devices.

What is claimed is:
 1. A computer program product for optimizing aresource manager thread pool in a production environment, the computerprogram product comprising: one or more non-transitory computer readablestorage media and program instructions stored on the one or morenon-transitory computer readable storage media, the program instructionscomprising: first program instructions programmed to divide a set ofvouchers into a plurality of voucher subsets so that each voucher subsetrespectively corresponds to a resource manager of a plurality ofresource managers, where each resource manager of the plurality ofresource managers respectively corresponds to a resource in anapplication server and where each voucher subset correspondsrespectively to a thread subset associated with the resource andclustered based on the resource; second program instructions programmedto receive a plurality of incoming pending requests with each incomingpending request respectively corresponding to a resource; third programinstructions programmed to temporarily remove a voucher from its vouchersubset corresponding to a given resource manager upon each instance thata given pending incoming request is assigned to that given resourcemanager for responsive processing such that the given pending incomingrequest thereby becomes an assigned request; fourth program instructionsprogrammed to determine which request of the plurality of pendingincoming requests will be next assigned to a corresponding resourcemanager based, at least in part, upon which resource manager has thegreatest number of vouchers in its respective subset of vouchers; fifthprogram instructions programmed to assign the plurality of pendingincoming requests to a corresponding resource manager for execution by athread associated with the thread subset; and sixth program instructionsprogrammed to return a temporarily removed voucher to its voucher subsetcorresponding to a given resource manager upon each instance that thegiven resource manager has completed responsive processing of a givenassigned request such that the given assigned request thereby becomes acompleted request.
 2. The computer program product of claim 1 whereinthe software further comprises: seventh program instructions programmedto assign a first pending incoming request to a first resource managerof the plurality of resource managers by assigning a first work managerthread to the first pending incoming request such that the first pendingincoming request thereby becomes a first assigned request; and eighthprogram instructions programmed to complete the first assigned requestby removing the assigned from the first work manager thread such thatthe first assigned request thereby becomes the first completed request.3. The computer program product of claim 1 wherein: the first programinstructions are further programmed to divide the set of vouchers into aplurality of voucher subsets based upon an expected ratio betweenrespective numbers of expected pending incoming requests thatrespectively correspond to each resource of the plurality of resources.4. The computer program product of claim 1 wherein: the fourth programinstructions are further programmed to determine which request of theplurality of pending incoming requests will be next assigned to acorresponding resource manager by selecting a pending incoming requestthat is the earliest received request corresponding to a resourcemanager with the greatest number of vouchers in its correspondingvoucher subset.
 5. A computer system for optimizing a resource managerthread pool in a production environment, the computer system comprising:a processor(s) set; and a software storage device; wherein: theprocessor set is structured, located, connected and/or programmed to runsoftware stored on the software storage device; and the softwarecomprises: first program instructions programmed to divide a set ofvouchers into a plurality of voucher subsets so that each voucher subsetrespectively corresponds to a resource manager of a plurality ofresource managers, where each resource manager of the plurality ofresource managers respectively corresponds to a resource in anapplication server and where each voucher subset correspondsrespectively to a thread subset associated with the resource andclustered based on the resource; second program instructions programmedto receive a plurality of incoming pending requests with each incomingpending request respectively corresponding to a resource; third programinstructions programmed to temporarily remove a voucher from its vouchersubset corresponding to a given resource manager upon each instance thata given pending incoming request is assigned to that given resourcemanager for responsive processing such that the given pending incomingrequest thereby becomes an assigned request; fourth program instructionsprogrammed to determine which request of the plurality of pendingincoming requests will be next assigned to a corresponding resourcemanager based, at least in part, upon which resource manager has thegreatest number of vouchers in its respective subset of vouchers; fifthprogram instructions programmed to assign the plurality of pendingincoming requests to a corresponding resource manager for execution by athread associated with the thread subset; and sixth program instructionsprogrammed to return a temporarily removed voucher to its voucher subsetcorresponding to a given resource manager upon each instance that thegiven resource manager has completed responsive processing of a givenassigned request such that the given assigned request thereby becomes acompleted request.
 6. The system of claim 5 wherein the software furthercomprises: seventh program instructions programmed to assign a firstpending incoming request to a first resource manager of the plurality ofresource managers by assigning a first work manager thread to the firstpending incoming request such that the first pending incoming requestthereby becomes a first assigned request; and eighth programinstructions programmed to complete the first assigned request byremoving the assigned from the first work manager thread such that thefirst assigned request thereby becomes the first completed request. 7.The system of claim 5 wherein: the first program instructions arefurther programmed to divide the set of vouchers into a plurality ofvoucher subsets based upon an expected ratio between respective numbersof expected pending incoming requests that respectively correspond toeach resource of the plurality of resources.
 8. The system of claim 5wherein: the fourth program instructions are further programmed todetermine which request of the plurality of pending incoming requestswill be next assigned to a corresponding resource manager by selecting apending incoming request that is the earliest received requestcorresponding to a resource manager with the greatest number of vouchersin its corresponding voucher subset.
 9. A system comprising: aprocessor; and a memory having program instructions embodied therewith,the program instructions configured, when executed by the processor, tocause the processor to perform a method comprising: dividing, by one ormore processors, a set of vouchers into a plurality of voucher subsetsso that each voucher subset respectively corresponds to a resourcemanager of a plurality of resource managers, where each resource managerof the plurality of resource managers respectively corresponds to aresource in an application server of a plurality of application serversconnected by a network and where each voucher subset correspondsrespectively to a thread subset associated with the resource andclustered based on the resource; receiving, by the one or moreprocessors, a plurality of incoming pending requests with each incomingpending request respectively corresponding to a resource wherein theplurality of incoming pending requests come from the plurality ofapplication servers; temporarily removing, by the one or moreprocessors, a voucher from its voucher subset corresponding to a givenresource manager upon each instance that a given pending incomingrequest is assigned to that given resource manager for responsiveprocessing such that the given pending incoming request thereby becomesan assigned request; determining, by the one or more processors, whichrequest of the plurality of pending incoming requests will be nextassigned to a corresponding resource manager based, at least in part,upon which resource manager has the greatest number of vouchers in itsrespective subset of vouchers; assigning, by the one or more processors,the plurality of pending incoming requests to a corresponding resourcemanager for execution by a thread associated with the thread subset andreturning, by the one or more processors, a temporarily removed voucherto its voucher subset corresponding to a given resource manager uponeach instance that the given resource manager has completed responsiveprocessing of a given assigned request such that the given assignedrequest thereby becomes a completed request.